import { DataTypes, Model } from "sequelize";
import sequelize from "@db/sequelize";

interface ILine {
    name: string;
    hexColor: string;
}

export class MetroStation extends Model {
    declare id: number;
    declare name: string;
    declare line: ILine;
    declare cityId: number;
}

MetroStation.init(
    {
        id: {
            type: DataTypes.INTEGER,
            allowNull: false,
            primaryKey: true,
            autoIncrement: true,
            unique: true,
        },
        name: {
            type: DataTypes.STRING,
            allowNull: false,
        },
        line: {
            type: DataTypes.JSONB,
        },
    },
    {
        tableName: "geo-metro-station",
        sequelize,
        timestamps: false,
    }
);
